package com.xiaoshuidi.cloud.module.report.service.contract;

import com.xiaoshuidi.cloud.module.report.dal.DO.report.ReportContractDayRentDO;
import com.xiaoshuidi.cloud.module.report.dal.DO.report.ReportContractInfoDO;
import com.xiaoshuidi.cloud.module.report.dal.DO.report.ReportOwnerContractDayRentDO;

import java.time.LocalDate;
import java.util.List;

public interface ContractOperateService {

    /**
     * 查询上月有收入的合同 统计合同状态有已生效，已入住,正常结束，非正常结束
     */
    long countHaveIncomeContractsByDate(LocalDate startDate, LocalDate endDate);

    long countHaveIncomeContractsYesterday(LocalDate yesterday);
    /**
     * 查询上月有收入的合同 统计合同状态有已生效，已入住,正常结束，非正常结束
     */
    List<ReportContractInfoDO> selectHaveIncomeContractsByDate(LocalDate startDate, LocalDate endDate);


    List<ReportContractInfoDO> selectHaveIncomeContractsYesterday(LocalDate yesterday);

    /**
     * 查询上月有收入的合同 统计合同状态有已生效，已入住,正常结束，非正常结束
     */
    List<ReportContractInfoDO> selectHaveIncomeContractsByDateInTurn(LocalDate startDate, LocalDate endDate, Integer from, Integer pageSize);

    List<ReportContractInfoDO> selectHaveIncomeContractsYesterdayInTurn(LocalDate yesterday, Integer from, Integer pageSize);

    /**
     * 合同日租金存库
     */
    void batchSaveContractDayRent(List<ReportContractDayRentDO> reportContractDayRentDOS);

    void batchOwnerSaveContractDayRent(List<ReportOwnerContractDayRentDO> reportContractDayRentDOS);


    List<ReportContractDayRentDO> selectListByContractId(Long contractId);
    List<ReportOwnerContractDayRentDO> selectOwnerListByContractId(Long contractId);

    ReportContractDayRentDO selectByContratIdAndDays(Long contractId,Integer monthDays);

    ReportOwnerContractDayRentDO selectOwnerByContractIdAndDays(Long contractId,Integer monthDays);
}
